﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Public;

namespace DAL
{
    public  class QuanHuyenDAL
    {
        public static List<QuanHuyenPublic> LoadQuanHuyen()
        {
            var quanhuyen = Common.db.ExecuteStoreQuery<QuanHuyenPublic>(@"select * from QuanHuyen");
            return quanhuyen.ToList();
        }
        //public static QuanHuyenPublic LoadQuanHuyenByMaQH(byte MaQH)
        //{ 
        //    var qh=Common.db.ExecuteStoreQuery<QuanHuyenPublic>(@"select MaQH from QuanHuyen where MaQH="+MaQH);
        //    return qh.FirstOrDefault();
        //}
        public static List<QuanHuyenPublic> LoadQuanHuyenByMaT(byte MaT)
        {
            var qh = Common.db.ExecuteStoreQuery<QuanHuyenPublic>(@"select * from QuanHuyen where MaT=" + MaT);
            return qh.ToList();
        }
    }
}
